<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>1.&nbsp;Spring Integration 2.2有何更新内容？</title>
<link rel="stylesheet" href="css/manual.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.75.2">
<link rel="home" href="index.html"
	title="Spring Integration Reference Manual">
<link rel="up" href="whats-new-part.html"
	title="Part&nbsp;I.&nbsp;What's new?">
<link rel="prev" href="whats-new-part.html"
	title="Part&nbsp;I.&nbsp;What's new?">
<link rel="next" href="spring-integration-introduction.html"
	title="Part&nbsp;II.&nbsp;Overview of Spring Integration Framework">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084"
	alink="#0000FF">
	<div class="navheader">
		<table width="100%" summary="Navigation header">
			<tr>
				<th colspan="3" align="center">1.&nbsp;Spring Integration 2.2有何更新内容？</th>
			</tr>
			<tr>
				<td width="20%" align="left"><a accesskey="p"
					href="whats-new-part.html">上一页</a>&nbsp;</td>
				<th width="60%" align="center">第一部分：本版本有何更新？</th>
				<td width="20%" align="right">&nbsp;<a accesskey="n"
					href="spring-integration-introduction.html">下一页</a></td>
			</tr>
		</table>
		<hr>
	</div>
	<div class="chapter"
		title="1.&nbsp;What's new in Spring Integration 2.2?">
		<div class="titlepage">
			<div>
				<div>
					<h2 class="title">
						<a name="whats-new"></a>1.&nbsp;Spring Integration 2.2有何更新内容？
					</h2>
				</div>
			</div>
		</div>

		<p>本章对2.2中更新的功能和改进的地方进行了简要的讲述。如果你希望了解更详细的信息，请查看我们的问题跟踪服务器中2.2解释的相关问题。</p>

		<div class="section" title="1.1&nbsp;New Components">
			<div class="titlepage">
				<div>
					<div>
						<h2 class="title" style="clear: both">
							<a name="2.2-new-components"></a>1.1&nbsp;新组件
						</h2>
					</div>
				</div>
			</div>

			<div class="section"
				title="1.1.1&nbsp;RedisStore Inbound and Outbound Channel Adapters">
				<div class="titlepage">
					<div>
						<div>
							<h3 class="title">
								<a name="2.2-redis-store-adapters"></a>1.1.1&nbsp;RedisStore输入输出通道适配器
							</h3>
						</div>
					</div>
				</div>

				<p>
					Spring Integration现在提供了RedisStore的输入输出通道适配器。你可以从Redis集合中读取Message内容，或者把Message写入Redis集合中去。更详细的信息请查看：<a
						class="xref"
						href="redis.html#redis-store-outbound-channel-adapter"
						title="22.6&nbsp;RedisStore Outbound Channel Adapter">Section&nbsp;22.6,
						&#8220;RedisStore Outbound Channel Adapter&#8221;</a> 和 <a
						class="xref" href="redis.html#redis-store-inbound-channel-adapter"
						title="22.5&nbsp;RedisStore Inbound Channel Adapter">Section&nbsp;22.5,
						&#8220;RedisStore Inbound Channel Adapter&#8221;</a>.
				</p>
			</div>
			<div class="section"
				title="1.1.2&nbsp;MongoDB Inbound and Outbound Channel Adapters">
				<div class="titlepage">
					<div>
						<div>
							<h3 class="title">
								<a name="2.2-mongo-adapters"></a>1.1.2&nbsp;MongoDB输入输出通道适配器
							</h3>
						</div>
					</div>
				</div>

				<p>
					Spring Integration现在提供了MongoDB输入输出通道适配器。你可以从MongoDB文档存贮数据库中读取Message内容，
					或者把Message写入MongoDB中去。更详细的信息请查看：<a
						class="xref" href="mongodb.html#mongodb-outbound-channel-adapter"
						title="21.5&nbsp;MongoDB Outbound Channel Adapter">Section&nbsp;21.5,
						&#8220;MongoDB Outbound Channel Adapter&#8221;</a> 和 <a class="xref"
						href="mongodb.html#mongodb-inbound-channel-adapter"
						title="21.4&nbsp;MongoDB Inbound Channel Adapter">Section&nbsp;21.4,
						&#8220;MongoDB Inbound Channel Adapter&#8221;</a>.
				</p>
			</div>
			<div class="section" title="1.1.3&nbsp;JPA Endpoints">
				<div class="titlepage">
					<div>
						<div>
							<h3 class="title">
								<a name="2.2-jpa"></a>1.1.3&nbsp;JPA 终结点
							</h3>
						</div>
					</div>
				</div>

				<p>Spring Integration提供了几个和Java持久化API（JPA）相关的组件，你可以用它们来获取JPA实体对象，或者持久化JPA实体对象。
				这些JPA适配器包括：</p>
				<div class="itemizedlist">
					<ul class="itemizedlist" type="disc">
						<li class="listitem">
							<p>
								<span class="emphasis"><em><a class="link"
										href="jpa.html#jpa-inbound-channel-adapter"
										title="18.4&nbsp;Inbound Channel Adapter">输入通道适配器</a></em></span>
							</p>
						</li>
						<li class="listitem">
							<p>
								<span class="emphasis"><em><a class="link"
										href="jpa.html#jpa-outbound-channel-adapter"
										title="18.5&nbsp;Outbound Channel Adapter">输出通道适配器</a></em></span>
							</p>
						</li>
						<li class="listitem">
							<p>
								<span class="emphasis"><em><a class="link"
										href="jpa.html#jpa-updating-outbound-gateway"
										title="18.6.2&nbsp;Updating Outbound Gateway">更新输出网关</a></em></span>
							</p>
						</li>
						<li class="listitem">
							<p>
								<span class="emphasis"><em><a class="link"
										href="jpa.html#jpa-retrieving-outbound-gateway"
										title="18.6.3&nbsp;Retrieving Outbound Gateway">获取输出网关</a></em></span>
							</p>
						</li>
					</ul>
				</div>
				<p>
					更详细的信息请查看：<a class="xref" href="jpa.html"
						title="18.&nbsp;JPA Support">Chapter&nbsp;18, <i>JPA
							Support</i></a>
				</p>
			</div>
		</div>

		<div class="section" title="1.2&nbsp;General Changes">
			<div class="titlepage">
				<div>
					<div>
						<h2 class="title" style="clear: both">
							<a name="2.2-general"></a>1.2&nbsp;整体性变化
						</h2>
					</div>
				</div>
			</div>

			<div class="section" title="1.2.1&nbsp;Spring 3.1 Used by Default">
				<div class="titlepage">
					<div>
						<div>
							<h3 class="title">
								<a name="2.2-spring-31"></a>1.2.1&nbsp;缺省使用Spring 3.1
							</h3>
						</div>
					</div>
				</div>

				<p>Spring Integration现在使用Spring 3.1.</p>
			</div>
			<div class="section" title="1.2.2&nbsp;Adding Behavior to Endpoints">
				<div class="titlepage">
					<div>
						<div>
							<h3 class="title">
								<a name="2.2-handler-advice"></a>1.2.2&nbsp;Adding Behavior to
								Endpoints
							</h3>
						</div>
					</div>
				</div>

				<p>The ability to add an &lt;advice-chain/&gt; to a poller has
					been available for some time. However, the behavior added by this
					affects the entire integration flow. It did not address the ability
					to add, say, retry, to an individual endpoint. The 2.2. release
					introduces the &lt;request-handler-advice-chain/&gt; to many
					endpoints.</p>
				<p>In addition, 3 standard Advice classes have been provided for
					this purpose:</p>
				<div class="itemizedlist">
					<ul class="itemizedlist" type="disc">
						<li class="listitem">MessageHandlerRetryAdvice</li>
						<li class="listitem">MessageHandlerCircuitBreakerAdvice</li>
						<li class="listitem">ExpressionEvaluatingMessageHandlerAdvice</li>
					</ul>
				</div>
				<p>
					For more information, see <a class="xref"
						href="messaging-endpoints-chapter.html#message-handler-advice-chain"
						title="7.7&nbsp;Adding Behavior to Endpoints">Section&nbsp;7.7,
						&#8220;Adding Behavior to Endpoints&#8221;</a>.
				</p>
			</div>
			<div class="section"
				title="1.2.3&nbsp;Transaction Synchronization and Pseudo Transactions">
				<div class="titlepage">
					<div>
						<div>
							<h3 class="title">
								<a name="2.2-transaction-sync"></a>1.2.3&nbsp;事务同步与伪事务
							</h3>
						</div>
					</div>
				</div>

				<p>
					poller现在可以参与到Spring的<span class="emphasis"><em>事务同步</em></span>功能中去. 
					这个改进使得通过输入通道进行文件改名等操作可以构建在事务之上，充分利用事务的提交和回滚功能。					
				</p>
				<p>
					如果某个处理并没有实际的事务支持，你还可以采用伪事务的方式来使用事务。伪事务由类
					<code class="classname">PseudoTransactionManager</code>提供支持
					.
				</p>
				<p>
					更详细的信息请查看：<a class="xref"
						href="transactions.html#transaction-synchronization"
						title="B.3&nbsp;Transaction Synchronization">Section&nbsp;B.3,
						&#8220;Transaction Synchronization&#8221;</a>.
				</p>
			</div>
			<div class="section"
				title="1.2.4&nbsp;File Adapter - Improved File Overwrite/Append Handling">
				<div class="titlepage">
					<div>
						<div>
							<h3 class="title">
								<a name="2.2-file-adapter"></a>1.2.4&nbsp;文件适配器 —— 改进文件覆盖和追加处理
							</h3>
						</div>
					</div>
				</div>

				<p>
					<span class="emphasis"><em>文件输出通道适配器</em></span>和
					<span class="emphasis"><em>文件输出网关</em></span>支持一种新的<span class="emphasis"><em>模式</em></span>
					属性。 <span class="emphasis"><em>Spring
							Integration 2.2</em></span>之前，目前文件一旦存在就会被替换。现在你可以选择下面这种选项：
				</p>
				<div class="itemizedlist">
					<ul class="itemizedlist" type="disc">
						<li class="listitem">REPLACE (缺省)</li>
						<li class="listitem">APPEND</li>
						<li class="listitem">FAIL</li>
						<li class="listitem">IGNORE</li>
					</ul>
				</div>
				<p>
					更详细的信息请查看：<a class="xref"
						href="files.html#file-writing-destination-exists"
						title="12.3.2&nbsp;Dealing with Existing Destination Files">Section&nbsp;12.3.2,
						&#8220;Dealing with Existing Destination Files&#8221;</a>.
				</p>
			</div>
			<div class="section"
				title="1.2.5&nbsp;Reply-Timeout added to more Outbound Gateways">
				<div class="titlepage">
					<div>
						<div>
							<h3 class="title">
								<a name="2.2-outbound-gateways"></a>1.2.5&nbsp;更多的输出网关支持“Reply-Timeout”
							</h3>
						</div>
					</div>
				</div>

				<p>
					下面的这些<span class="emphasis"><em>输入网关</em></span>的XML命名空间支持
					<span class="emphasis"><em>reply-timeout</em></span>属性：
				</p>
				<div class="itemizedlist">
					<ul class="itemizedlist" type="disc">
						<li class="listitem">AMQP输出网关</li>
						<li class="listitem">文件输出网关</li>
						<li class="listitem">FTP输出网关</li>
						<li class="listitem">SFTP输出网关</li>
						<li class="listitem">WS输出网关</li>
					</ul>
				</div>
			</div>
			<div class="section" title="1.2.6&nbsp;Spring-AMQP 1.1">
				<div class="titlepage">
					<div>
						<div>
							<h3 class="title">
								<a name="2.2-amqp-11"></a>1.2.6&nbsp;Spring-AMQP 1.1
							</h3>
						</div>
					</div>
				</div>

				<p>Spring Integration目前使用Spring AMQP 1.1。由此，下面的这些功能在Spring Integration中获得支持：</p>
				<div class="itemizedlist">
					<ul class="itemizedlist" type="disc">
						<li class="listitem">输出网关可以采用固定的应答队列</li>
						<li class="listitem">HA （镜像） 队列</li>
						<li class="listitem">发布方确定功能</li>
						<li class="listitem">Returned Messages</li>
						<li class="listitem">支持Dead Letter交换和Dead Letter队列</li>
					</ul>
				</div>
			</div>
			<div class="section"
				title="1.2.7&nbsp;JDBC Support - Stored Procedures Components">
				<div class="titlepage">
					<div>
						<div>
							<h3 class="title">
								<a name="2.2-jdbc-11"></a>1.2.7&nbsp;JDBC支持改进 —— 存储过程组件
							</h3>
						</div>
					</div>
				</div>

				<p>
					<span class="emphasis"><em>SpEL支持</em></span>
				</p>
				<p>When using the Stored Procedure components of the Spring
					Integration JDBC Adapter, you can now provide Stored Procedure
					Names or Stored Function Names using Spring Expression Language
					(SpEL).</p>
				<p>
					This allows you to specify the Stored Procedures to be invoked at
					runtime. For example, you can provide Stored Procedure names that
					you would like to execute via Message Headers. For more information
					please see <a class="xref" href="jdbc.html#stored-procedures"
						title="17.5&nbsp;Stored Procedures">Section&nbsp;17.5,
						&#8220;Stored Procedures&#8221;</a>.
				</p>
				<p>
					<span class="emphasis"><em>JMX Support</em></span>
				</p>
				<p>The Stored Procedure components now provide basic JMX
					support, exposing some of their properties as MBeans:</p>
				<div class="itemizedlist">
					<ul class="itemizedlist" type="disc">
						<li class="listitem">Stored Procedure Name</li>
						<li class="listitem">Stored Procedure Name Expression</li>
						<li class="listitem">JdbcCallOperations Cache Statistics</li>
					</ul>
				</div>
			</div>
			<div class="section"
				title="1.2.8&nbsp;JDBC Support - Outbound Gateway">
				<div class="titlepage">
					<div>
						<div>
							<h3 class="title">
								<a name="2.2-jdbc-gateway-update-optional"></a>1.2.8&nbsp;JDBC
								Support - Outbound Gateway
							</h3>
						</div>
					</div>
				</div>

				<p>When using the JDBC Outbound Gateway, the update query is no
					longer mandatory. You can now provide solely a select query using
					the request message as a source of parameters.</p>
			</div>
			<div class="section"
				title="1.2.9&nbsp;JDBC Support - Channel-specific Message Store Implementation">
				<div class="titlepage">
					<div>
						<div>
							<h3 class="title">
								<a name="2.2-jdbc-message-store-channels"></a>1.2.9&nbsp;JDBC
								Support - Channel-specific Message Store Implementation
							</h3>
						</div>
					</div>
				</div>

				<p>
					A new <span class="emphasis"><em>Message Channel</em></span>-specific
					Message Store Implementation has been added, providing a more
					scalable solution using database-specific SQL queries. For more
					information please see: <a class="xref"
						href="jdbc.html#jdbc-message-store-channels"
						title="17.4.2&nbsp;Backing Message Channels">Section&nbsp;17.4.2,
						&#8220;Backing Message Channels&#8221;</a>.
				</p>
			</div>
			<div class="section" title="1.2.10&nbsp;Orderly Shutdown">
				<div class="titlepage">
					<div>
						<div>
							<h3 class="title">
								<a name="2.2-shutdown"></a>1.2.10&nbsp;顺序关闭
							</h3>
						</div>
					</div>
				</div>

				<p>
					IntegrationMBeanExporter中加入了<code class="classname">stopActiveComponents()</code>
					方法。该方法使得Spring Integration应用程序按一定的处理次序来停止运行。
					这样，你可以禁止向某些适配器生成新的输入消息，并等待一定的时间，让已经入站的消息处理完成。
				</p>
			</div>
			<div class="section"
				title="1.2.11&nbsp;JMS Oubound Gateway Improvements">
				<div class="titlepage">
					<div>
						<div>
							<h3 class="title">
								<a name="2.2-jms-og"></a>1.2.11&nbsp;JMS输出网关的改进
							</h3>
						</div>
					</div>
				</div>

				<p>
					JMS输入网关可以采用
					<code class="interfacename">MessageListener</code>
					容器来收取应答。这样做可以提升网关的性能。
				</p>
			</div>
			<div class="section" title="1.2.12&nbsp;object-to-json-transformer">
				<div class="titlepage">
					<div>
						<div>
							<h3 class="title">
								<a name="2.2-o-t-j-t"></a>1.2.12&nbsp;object-to-json-transformer
							</h3>
						</div>
					</div>
				</div>

				<p>					
					<code class="classname">ObjectToJsonTransformer</code>
					把<span class="emphasis"><em>content-type</em></span>
					缺省设置为<span class="emphasis"><em>application/json</em></span>
					。详细信息请查看：<a class="xref"
						href="messaging-transformation-chapter.html#transformer"
						title="6.1&nbsp;Transformer">Section&nbsp;6.1,
						&#8220;Transformer&#8221;</a>.
				</p>
			</div>
			<div class="section" title="1.2.13&nbsp;HTTP Support">
				<div class="titlepage">
					<div>
						<div>
							<h3 class="title">
								<a name="httpChanges"></a>1.2.13&nbsp;HTTP支持
							</h3>
						</div>
					</div>
				</div>

				<p>
					Java serialization over HTTP is no longer enabled by default.
					Previously, when setting a
					<code class="code">expected-response-type</code>
					to a
					<code class="code">Serializable</code>
					object, the
					<code class="code">Accept</code>
					header was not properly set up. The
					<code class="classname">SerializingHttpMessageConverter</code>
					has now been updated to set the Accept header to
					<code class="code">application/x-java-serialized-object</code>
					. However, because this could cause incompatibility with existing
					applications, it was decided to no longer automatically add this
					converter to the HTTP endpoints.
				</p>
				<p>
					If you wish to use Java serialization, you will need to add the
					<code class="classname">SerializingHttpMessageConverter</code>
					to the appropriate endpoints, using the
					<code class="code">message-converters</code>
					attribute, when using XML configuration, or using the
					<code class="code">setMessageConverters()</code>
					method.
				</p>
				<p>
					Alternatively, you may wish to consider using JSON instead which is
					enabled by simply having
					<code class="code">Jackson</code>
					on the classpath.
				</p>
			</div>
		</div>
	</div>
	<div class="navfooter">
		<hr>
		<table width="100%" summary="Navigation footer">
			<tr>
				<td width="40%" align="left"><a accesskey="p"
					href="whats-new-part.html">Prev</a>&nbsp;</td>
				<td width="20%" align="center"><a accesskey="u"
					href="whats-new-part.html">Up</a></td>
				<td width="40%" align="right">&nbsp;<a accesskey="n"
					href="spring-integration-introduction.html">Next</a></td>
			</tr>
			<tr>
				<td width="40%" align="left" valign="top">Part&nbsp;I.&nbsp;What's
					new?&nbsp;</td>
				<td width="20%" align="center"><a accesskey="h"
					href="index.html">Home</a></td>
				<td width="40%" align="right" valign="top">&nbsp;Part&nbsp;II.&nbsp;Overview
					of Spring Integration Framework</td>
			</tr>
		</table>
	</div>
	<!-- Begin 2nd Google code - a mod -->
	<script type="text/javascript">
		var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl."
				: "http://www.");
		document
				.write(unescape("%3Cscript src='"
						+ gaJsHost
						+ "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
	</script>
	<script type="text/javascript">
		var OrgTracker = _gat._getTracker("UA-2728886-2");
		OrgTracker._setDomainName("none");
		OrgTracker._setAllowLinker(true);
		OrgTracker._trackPageview();
	</script>
	<!-- End 2nd Google code -->


	<script type="text/javascript">
		function detectLastFrame() {
			var thisF = this.window;
			var allF = parent.top.frames;
			return allF[allF.length - 1] == thisF;
		}

		// Only inject the following code if this is a normal page or the last // frame of a frameset.
		if (parent.top.frames.length == 0 || detectLastFrame()) {
			// Inject the SpringSource search widget too.
			document
					.write(unescape("%3Cscript src='http://search.springsource.org/widget/searchtool.js' type='text/javascript'%3E%3C/script%3E"));
			// Inject the Eloqua code
			document
					.write(unescape("%3Cscript src='/elqNow/elqCfg.js' type='text/javascript'%3E%3C/script%3E"));
			document
					.write(unescape("%3Cscript src='/elqNow/elqImg.js' type='text/javascript'%3E%3C/script%3E"));

		}
	</script>
</body>
</html>